<?php
class Notifier
{
  private static $notifications = array();
  private static $notifier      = null;
  
  public function addNotification($notification)
  {
    self::$notifications[] = $notification;
  }
  
  public function getNotifier()
  {
    if(self::$notifier==null)
    {
      self::$notifier = new Notifier();
    }
    
    return self::$notifier;
  }
  
  public function send($subject, $message)
  {
    foreach (self::$notifications as $notification)
    {
      $notification->send($subject, $message);
    }
  }
}